home *** CD-ROM | disk | FTP | other *** search
- # ifndef __SERVER_AGENT__
- # define __SERVER_AGENT__
- /*
- * File - ServerAgent.h
- * Defines for Server Agent access across the NuBus
- *
- *
- * Copyright Apple Computer, Inc. 1987, 1988, 1989, 1990
- * All Rights Reserved.
- *
- * Apple Need to Know Confidential
- *
- * Jim Christy, Rick Holzgrafe, Scott Leahy, Tom Robertson, Dave Willey
- *
- * Change Log:
- *
- * 11.13.90 JEC • Added Change Log.
- * • Updated security and copyright notices.
- * • added defines for ClientNote reliablity.
- *
- */
-
- #include <X25_System.h>
-
- /*
- * Message codes (mCode)
- *
- * mCodes 0x120 thru 0x13F and 0x150 thru 0x17F,
- * are for use between Servers and the server agent,
- * and should not be used for any other purpose.
- *
- * mCodes 0x180 thru 0x20F are for use between Authenticators and the server agent,
- * and should not be used for any other purpose.
- *
- */
-
- #define LMSon 0x120 /* client application enables LMS */
- #define AckLMSon 0x121
-
- /* Subcodes for tracing in mOData [0] */
-
- #define LMSFrameTraceON 0
- #define LMSFrameTraceOFF 1
- #define LMSPacketTraceON 2
- #define LMSPacketTraceOFF 3
-
- #define LMSoff 0x122 /* client application disables LMS */
- #define AckLMSoff 0x123
- #define LMSData 0x124 /* server sends LMS output to client */
- #define AckLMSData 0x125
- #define UserData 0x12c /* user data to network server */
- #define AckUserData 0x12d /* server acknowledgement of user data */
- #define NetWrkData 0x12e /* data passed from the network server to the user */
- #define AckNetData 0x12f /* acknowledgement of network data */
- #define ServerReg 0x132 /* network server for registration */
- #define SvrRegAck 0x133 /* server registration acknowledgement */
- #define CheckCard 0x134 /* tickle packet to test if card is still alive */
- #define ChkCardAck 0x135 /* ack from live card */
- #define CktShtDwn 0x136 /* shut down circuit after all data is sent */
- /* CKtSHtDwn is not acked, so 0x137 is not used */
-
- /* mCodes 138-14f reserved for server's internal use */
-
- #define ServerDeReg 0x150 /* network server de-registry */
- #define SvrDRegAck 0x151 /* network server de-registry acknowledgment */
- #define CktAbort 0x152 /* shut down circuit with possible loss of data */
- /* CktAbort is not acked, so 0x153 is not used */
- #define OpenReq 0x154 /* agent requests new circuit */
- #define OpenReqAck 0x155 /* new circuit request acknowledgment */
- #define UserIData 0x156 /* incomplete user data to network server */
- #define AckUserIData 0x157 /* server acknowledgement of incomplete user data */
- #define NetIData 0x158 /* incomplete data from network server to the user */
- #define AckNetIData 0x159 /* acknowledgement of incomplete network data */
-
- #define Claim 0x180 /* Authenticator claims a server */
- #define ClaimAck 0x181 /* Server Agent acknowledges Claim */
- #define QuitClaim 0x182 /* Authenticator disclaims a server */
- #define QuitClaimAck 0x183 /* Server Agent acknowledges QuitClaim */
- #define StatusReq 0x184 /* Server Agent requests status from Authenticator */
- #define StatusReqAck 0x185 /* Authenticator acknowledges StatusReq */
- #define Validate 0x186 /* Server Agent requests password validation */
- #define ValidateAck 0x187 /* Authenticator acknowledges Validate */
- #define DeathNote 0x188 /* Server Agent sends death notification */
- #define DeathNoteAck 0x189 /* Authenticator acknowledges DeathNote */
- #define LOGINNOTE 0x18A /* Server Agent sends login notification */
- #define LOGINNOTEACK 0x18B /* Authenticator acknowledges DeathNote */
- #define LogoutNote 0x18C /* Server Agent sends logout notification */
- #define LogoutNoteAck 0x18D /* Authenticator acknowledges DeathNote */
- #define BBEListReq 0x18E /* Server Agent requests Black Book Entry list */
- #define BBEListReqAck 0x18F /* Authenticator acks Black Book Entry list req */
- #define BBEList 0x190 /* Authenticator sends Black Book Entry list */
- #define BBEListAck 0x191 /* Server Agent acks Black Book Entry list */
- #define BBGetEntry 0x192 /* Server Agent requests Black Book Entry */
- #define BBGetEntryAck 0x193 /* Authenticator acks Black Book Entry req */
- #define BBEntry 0x194 /* Authenticator sends Black Book Entry */
- #define BBEntryAck 0x195 /* Server Agent acks Black Book Entry */
- #define ClientNote 0x196 /* Message to be passed to a client */
- #define ClientNoteAck 0x197 /* Server Agent acks ClientNote */
-
- /*
- * mStatus values (for least significant byte of mStatus) for error returns
- * 0x00 is "OK"
- * 0x01 - 0x1F reserved for Agent-Server or Server-Agent replies
- * 0x20 - 0x3F reserved for Agent-Authenticator or Authenticator-Agent replies
- * (These are also used in status field of ADSP login protocol messages)
- */
- /* OS_UNKNOWN_MESSAGE is defined in MR-DOS managers.h, and means "unrecognized mCode" */
- #define SAE_OK 0x00 /* "All's Well" */
-
- #define SAE_NULL_DATA 0x01 /* mDataPtr is NULL, and shouldn't be */
- #define SAE_ZERO_DATA 0x02 /* mDataSize is zero, and shouldn't be */
- #define SAE_VCID_UNKNOWN 0x03 /* VCID (in mOData[0]) is not recognized */
- #define SAE_DUP_REG 0x04 /* ServerReg fails: name and type already in use */
- #define SAE_NO_ROOM 0x05 /* ServerReg fails: too many servers already registered */
- #define SAE_BAD_NAME 0x06 /* ServerReg fails: name or type too long */
- #define SAE_PRI_OVERFLOW 0x07 /* Priority message too long: it was sent but was */
- /* truncated to the maximum allowable length */
-
- #define SAE_SRVR_UNKNOWN 0x20 /* On any reply: unknown server */
- #define SAE_DUP_CLAIM 0x21 /* Claim or QuitClaim fails: server already claimed */
- #define SAE_BAD_PASS 0x22 /* Validation fails: password is incorrect */
- #define SAE_USER_UNKNOWN 0x23 /* Validation fails: username not recognized */
- #define SAE_PASS_NO_CHANGE 0x24 /* Validation succeeds, but password change fails */
-
- #define SAE_NO_AUTHENT 0x26 /* No Authenticator available for this Server */
- #define SAE_BAD_METHOD 0x27 /* Authentication method not permitted */
- #define SAE_BAD_MESSAGE 0x28 /* Message format incorrect or unexpected */
- #define SAE_NOT_NOW 0x29 /* Authenticator refuses all logins categorically */
-
-
- #define LME_BufferTooLarge 0x30 /* data buffer exceeds LMS input size */
- #define LME_LMSBusy 0x31 /* LMS unable to process command since it is busy */
-
- /*
- * Object and Type of the Server Agent as registered with MR-DOS Name Manager
- */
- #define AgentName "ADSP Agent" /* Agent's Registered Object name */
- #define AgentType "Server Agent" /* Agent's Registered Type */
-
-
- /*
- * Message priority
- * MR-DOS messages with mPriority >= SA_PRIORITY are treated
- * as priority messages; others are ordinary messages.
- */
- # define SA_PRIORITY ((unsigned short)0x8000)
-
-
- /*
- * Data Structures for the Login protocol between Server Agent and Client,
- * carried over ADSP. Each message must be followed by ADSP end-of-message flag.
- */
-
- #define SAC_MSG_VERSION 0x01 /* Message version number */
-
- #define PASS_SZ 8 /* Passwords and tokens are this many bytes long. */
- /* Shorter passwords are padded on the right with NULLs */
-
- /*
- * Values for msgType fields.
- * Values 0-127 are reserved for Server Agent;
- * high bit is reserved for error returns;
- * values 128-32767 are available for arbitrary use by users.
- */
- typedef short SAC_msgType;
-
- /* Login messages */
- #define serviceReq 1
- #define loginPrompt 2
- #define loginReq 3
- #define loginReply 4
- /* Black Book messages */
- #define listReq 5
- #define listReply 6
- #define entryReq 7
- #define entryReply 8
-
-
- /*
- * Values for serviceKind field of serviceReqMsg
- */
- typedef enum
- {
- connectToServer, verifyPassword, getLoginMethods, getAddresses
- } SAC_serviceType;
-
- /*
- * Access method and other bit flags.
- * These are used both in the ADSP messages to and from the Client,
- * and in the MR-DOS messages to and from the Authenticator, during Authentication.
- * Not all flags are meaningful in every message.
- */
- typedef struct
- {
- unsigned guestOK :1; /* Guest login permitted */
- unsigned registerOK :1; /* Registered user login permitted */
- unsigned DES_OK :1; /* DES-encrypted passwords permitted */
- unsigned clearOK :1; /* Cleartext passwords permitted */
- unsigned changeOK :1; /* User may change password */
- unsigned deathNote :1; /* Authenticator requests death notification */
- unsigned freeAccess :1; /* Authenticator allows login-less access to Server */
- unsigned loginNote :1; /* Authenticator requests log in/out notification */
- unsigned doBlackBook :1; /* Authenticator accepts Black Book requests */
- unsigned reserved :7; /* Reserved for future use */
- } accessBits;
-
- /*
- * Definitions of the four Agent-Client login protocol messages carried over ADSP.
- */
- typedef struct
- {
- _X25_common_header cmn_hdr;
- SAC_msgType msgType; /* Always serviceReq */
- char msgVersion; /* Always SAC_MSG_VERSION */
- SAC_serviceType serviceKind; /* Kind of service requested */
- } serviceReqMsg;
-
- typedef struct
- {
- _X25_common_header cmn_hdr;
- SAC_msgType msgType; /* One of loginPrompt, loginReq, or loginReply */
-
- char msgVersion; /* Always SAC_MSG_VERSION */
-
- char status; /* For loginPrompt and loginReply: */
- /* SAE_OK, or error */
- /* For loginReq: */
- /* Unused */
-
- accessBits access; /* For loginPrompt and loginReply: */
- /* Login methods permitted */
- /* For loginReq: */
- /* Login method being used */
-
- char pass1[PASS_SZ]; /* For loginPrompt and loginReply: */
- /* Token for DES-encoding */
- /* For loginReq: */
- /* Current password, either clear or DES-encoded */
-
- char pass2[PASS_SZ]; /* For loginReq: */
- /* New password, in clear, for changing password */
- /* For loginPrompt and loginReply: */
- /* Unused */
-
- char stringData[0]; /* For loginPrompt: */
- /* Pascal string: Server Agent version string */
- /* For loginReq: */
- /* Pascal string: User's Name */
- /* For loginReply: */
- /* Unused */
- } loginMsg;
-
- /* used in ClientNote messages in the mOData[2] filed of the AROSE message to denote */
- /* reliablity requirements for the Client Notice. */
-
- #define RELIABLE 0L // used when sending shutdown warning messages
- #define UNRELIABLE 7L
-
- # endif __SERVER_AGENT__
-
-